package com.mask.collections;

import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.Scanner;
import java.util.TreeSet;

/**
 * ClassName SetDemo
 * Create by hx
 * Date 2021/9/15 10:32 上午
 */

public class SetDemo {
    public static void main(String[] args) {
        TreeSet<String> set = new TreeSet<>();
        Scanner scanner = new Scanner(System.in);
        for (int i = 0; i < 20; i++) {
            set.add(scanner.next());
        }
        System.out.println("输入的20个字符串排序为:");
        for (String item : set){
            System.out.print(item+" ");
        }
    }
}
